package com.hornsun.data.dbo;

import com.hornsun.util.ObjByteUtil;

import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.InputStream;

/**
 * Created by 编译中... on 2018/6/26.
 */
public class PumpData {
    public byte[] szName = new byte[16];
    public int nToken;

    public static PumpData fromBytesArray(byte[] array) {
        try {
            InputStream stream = new ByteArrayInputStream(array);
            DataInputStream inputStream = new DataInputStream(stream);
            PumpData pumpData = new PumpData();
            inputStream.read(pumpData.szName, 0, 16);
            pumpData.nToken = ObjByteUtil.BytesOrderConv(inputStream.readInt());
            return pumpData;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}
